package myInvoke;

import javassist.ClassPool;

import java.lang.reflect.Proxy;
import java.sql.PreparedStatement;

public class MyProxy {

    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        Object o = Proxy.newProxyInstance(MyProxy.class.getClassLoader(), new Class[]{TargetClass.class}, new MyHandler());
        o = (TargetClass) o;
        Info info = ((TargetClass) o).printInfo();
        System.out.println(info.name);
    }
}
